﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Cofe.Core;
using Cofe.Core.Implements;

namespace Cofe.Web
{
    public static class IEntrySerializerHelperExtension
    {
        public static CofeSystemInfo FindFunc(this IEntrySerializerHelper[] helpers, ParameterDic parameters)
        {
            foreach (var h in helpers)
            {
                var e = h.FindFunc(parameters);
                if (e != null)
                    return e;
            }
            return null;
        }

        public static void UpdateFunc(this IEntrySerializerHelper[] helpers, CofeSystemInfo entry, ParameterDic parameters)
        {
            foreach (var h in helpers)
            {
                h.UpdateFunc(entry, parameters);
            }
        }
    }
}
